package com.hqyj.javaSpringBoot.modules.common.entity;

import org.apache.commons.lang3.StringUtils;

public class SearchBean {
    public final static int DEFAULT_CURRENT_PAGE = 1;
    public final static int DEFAULT_PAGE_SIZE = 5;

    private int currentPage;
    private int pageSize;
    private String orderBy;
    private String direction;
    private String keyword;

    public void initSearchBean(){
        if (this == null) {
            return;
        }
        this.currentPage = DEFAULT_CURRENT_PAGE;
        this.pageSize = DEFAULT_PAGE_SIZE;
        //为空
     /*   if (StringUtils.isBlank(this.orderBy)) {
            this.orderBy = "id";
        }
        if (StringUtils.isBlank(this.direction)) {
            this.direction = "asc";
        }
        if (StringUtils.isBlank(this.keyword)) {
            this.keyword = "";
        }*/
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }
}
